<div class="card card-default">
  <div class="card-header">
    数据管理
    <button class="btn btn-primary btn-sm" style="float:right;margin-right: 10px;" (click)="addData()">添加</button>
  </div>
  <div class="card-body">
    <table class="table table-striped table-hover">
      <thead class="thead-dark">
        <tr>
          <th *ngFor="let field of fields">{{field.title}}</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
        <tr *ngFor="let item of list;index as i;">
          <td *ngFor="let field of fields">{{item[field.name]}}</td>
          <td>
            <a class="btn btn-sm">编辑</a>
            <a class="btn btn-sm">删除</a>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</div>